﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ClassLab
{
    public class Tree
    {
        public UInt32 id;
        public String poroda;
        public UInt16 age;
        public UInt32 hight;
        public static UInt32 countTree;
        static UInt32 maxId;
        Random seed = new Random();
        public string[] listPoroda = { "yasen", "topol", "bereza", "dub" };
        static Tree()
        {
            countTree = 0;
            maxId = 0;
        }
        public Tree()
        {
            this.id = maxId;
            this.poroda = listPoroda[seed.Next(0, listPoroda.Length-1)];
            countTree++;
            maxId++;
        }
        public Tree(UInt16 age)
            : this()
        {
            this.age = age;
            this.hight = (UInt32)seed.Next(1, 5) * age;
        }
        public Tree(UInt16 age, UInt32 hight)
            : this(age)
        {
            this.hight = hight;
        }
        public Tree(UInt16 age, UInt32 hight, String poroda)
            : this(age, hight)
        {
            this.poroda = poroda;
        }
        ~Tree()
        {
            countTree--;
        }
    }
}
